<?php
$pro = new Admin_Models_Product();
$pro = $this->proData;
$cat = new Admin_Models_Category();
?>
<a class="custom" href="javascript: history.go(-1);" >Trở lại</a>
<form name="" action="<?php echo URL_BASE . '/admin/product/editPro/' . $id; ?>" method="post" class="frm" enctype="multipart/form-data">
    <div class="info">
        <p>
            <label>Name:</label>
            <input type="text" name="txtName" id="" value="<?php echo $pro->getName(); ?>" />
        </p>
        <p>
            <label>Thumb:</label>
            <img src="<?php echo URL_BASE . DS . $pro->getThumb(); ?>" />
            <input type="hidden" name="txtProId" id="" value="<?php echo $pro->getProId(); ?>" />
            <input type="hidden" name="txtThumb" id="" value="<?php echo $pro->getThumb(); ?>" />
            <input type="hidden" name="txtPostDate" id="" value="<?php echo $pro->getPostDate(); ?>" />
            <input type="file" name="fThumb" id="" style="vertical-align: bottom;" />
        </p>
        <p>
            <label>Category:</label>
            <select name="sltCatId">
                <?php
                foreach ($cat->getParentCat() as $c) {
                    ?>
                <option value="<?php echo $c->getCatId(); ?>" <?php if ($pro->getCatId() == $c->getCatId()) echo 'selected'; ?>><?php echo $c->getName(); ?></option>
                    <?php
                    foreach ($cat->getChildCat($c->getCatId()) as $cc) {
                        ?>
                        <option value="<?php echo $cc->getCatId(); ?>" <?php if ($pro->getCatId() == $cc->getCatId()) echo 'selected'; ?>><?php echo "... " . $cc->getName(); ?></option>
                        <?php
                    }
                }
                ?>
            </select>
        </p>
        <p>
            <label>Description:</label>
            <textarea name="txtDescription"><?php echo $pro->getDescription(); ?></textarea>
        </p>
        <p>
            <label>Price (VNĐ):</label>
            <input type="text" name="txtPrice" id="" value="<?php echo $pro->getPrice(); ?>" />
        </p>
        <p>
            <label>Status:</label>
            <select name="sltStatus">
                <option value="0>" <?php if ($pro->getStatus() == 0) echo 'selected'; ?>>Hết hàng</option>
                <option value="1" <?php if ($pro->getStatus() == 1) echo 'selected'; ?>>Còn hàng</option>
            </select>
        </p>
        <p>

        </p>
        <p>
            <label></label>
            <input type="submit" value="Cập nhật" id="" />
        </p>
    </div>
</form>